﻿using log4net;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace app2
{
    public partial class end : Form
    {
        private static ILog _log = LogManager.GetLogger(typeof(end));
        public end()
        {
            InitializeComponent();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                Login login = new Login();
                login.Show();
                this.Hide();
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
                MessageBox.Show(ex.Message);
            }
        }
        private void end_Load(object sender, EventArgs e)
        {
            Database db = new Database();
            String sql1 = "select max(time) as 最高分 from time1";
            DataSet ds = new DataSet();
            ds = db.GetDataFromDB(sql1);
            dataGridView1.DataSource = ds.Tables[0];
            Database db2 = new Database();
            DataSet ds2 = new DataSet();
            String sql2 = "select max(time) as 最高分 from time2";
            ds2 = db2.GetDataFromDB(sql2);
            dataGridView2.DataSource = ds2.Tables[0];
        }
    }
}
